package com.hsgene.order.service.api;

import com.hsgene.common.util.result.ApiResult;
import com.hsgene.order.service.api.impl.OrderPayServiceImpl;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.Map;

/**
 * @author wxf
 * @date 2018/8/13 13:54
 **/
@FeignClient(name = "ms-mod-pay", path = "/v1.0/genetic/testing/pay", fallback = OrderPayServiceImpl.class)
public interface OrderPayService {
    /**
     * 订单支付
     *
     * @param orderId   订单id
     * @param payType   支付类型
     * @param payAmount 支付金额
     * @return 支付信息
     */
    @PostMapping("order_pay")
    ApiResult<Map<String, Object>> orderPay(@RequestParam("orderId") String orderId, @RequestParam("payType") String
            payType, @RequestParam("payAmount") int payAmount);

    /**
     * 对账查询
     *
     * @param orderId    订单
     * @param payOrderId 支付单
     * @return
     */
    @GetMapping("query_order")
    ApiResult<Map<String, Object>> queryPayOrder(@RequestParam("orderId") String orderId,
                                                 @RequestParam("payOrderId") String payOrderId);
}
